﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BOHVote.BLL;

namespace BOH.DataManagement
{
    public partial class InterviewPrint : System.Web.UI.Page
    {
        public static string PrintID = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetPrintInterview();
            }
        }

        public void GetPrintInterview()
        {
            DataSet dst = PrintContextClass.dstgetPrintContextByIDAndType("", "InterviewNotify");
            if (dst.Tables.Count > 0 && dst.Tables[0].Rows.Count > 0)
            {
                printContext.Value = dst.Tables[0].Rows[0]["PrintContext"].ToString();
                PrintID = dst.Tables[0].Rows[0]["PrintID"].ToString();
            }
        }

        protected void butSavePrint_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(PrintID))
            {
                PrintContextClass.UpdatePrintInteview(PrintID, printContext.Value);
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "<script>alert('更新成功');</script>");
            }
        }
    }
}
